/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jjsoft.disco.gco.mdl;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Johnny
 */
@Entity
@Table(catalog = "discodb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Ingreso.findAll", query = "SELECT i FROM Ingreso i"),
    @NamedQuery(name = "Ingreso.findByIdingreso", query = "SELECT i FROM Ingreso i WHERE i.idingreso = :idingreso"),
    @NamedQuery(name = "Ingreso.findByCodigo", query = "SELECT i FROM Ingreso i WHERE i.codigo = :codigo"),
    @NamedQuery(name = "Ingreso.findByHoraEntrada", query = "SELECT i FROM Ingreso i WHERE i.horaEntrada = :horaEntrada"),
    @NamedQuery(name = "Ingreso.findByHoraSalida", query = "SELECT i FROM Ingreso i WHERE i.horaSalida = :horaSalida"),
    @NamedQuery(name = "Ingreso.findByPagado", query = "SELECT i FROM Ingreso i WHERE i.pagado = :pagado"),
    @NamedQuery(name = "Ingreso.findByEstado", query = "SELECT i FROM Ingreso i WHERE i.estado = :estado"),
    @NamedQuery(name = "Ingreso.findByNumeroPersonasH", query = "SELECT i FROM Ingreso i WHERE i.numeroPersonasH = :numeroPersonasH")})
public class Ingreso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer idingreso;
    @Column(length = 25)
    private String codigo;
    @Temporal(TemporalType.TIMESTAMP)
    private Date horaEntrada;
    @Temporal(TemporalType.TIMESTAMP)
    private Date horaSalida;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(precision = 22)
    private Double pagado;
    private Integer estado;
    private Integer numeroPersonasH;
    private Integer numeroPersonasM;
    private Integer numeroManillasH;
    private Integer numeroManillasM;
    @JoinColumn(name = "factura", referencedColumnName = "numero")
    @ManyToOne
    private Factura factura;
    @JoinColumn(name = "cedula", referencedColumnName = "Cedula")
    @ManyToOne
    private Cliente cedula;

    public Ingreso() {
    }

    public Ingreso(Integer idingreso) {
        this.idingreso = idingreso;
    }

    public Integer getIdingreso() {
        return idingreso;
    }

    public void setIdingreso(Integer idingreso) {
        this.idingreso = idingreso;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public Date getHoraEntrada() {
        return horaEntrada;
    }

    public void setHoraEntrada(Date horaEntrada) {
        this.horaEntrada = horaEntrada;
    }

    public Date getHoraSalida() {
        return horaSalida;
    }

    public void setHoraSalida(Date horaSalida) {
        this.horaSalida = horaSalida;
    }

    public Double getPagado() {
        return pagado;
    }

    public void setPagado(Double pagado) {
        this.pagado = pagado;
    }

    public Integer getEstado() {
        return estado;
    }

    public void setEstado(Integer estado) {
        this.estado = estado;
    }

    public Integer getNumeroPersonasH() {
        return numeroPersonasH;
    }

    public void setNumeroPersonasH(Integer numeroPersonasH) {
        this.numeroPersonasH = numeroPersonasH;
    }

    public Integer getNumeroPersonasM() {
        return numeroPersonasM;
    }

    public void setNumeroPersonasM(Integer numeroPersonasM) {
        this.numeroPersonasM = numeroPersonasM;
    }

    public Integer getNumeroManillasH() {
        return numeroManillasH;
    }

    public void setNumeroManillasH(Integer numeroManillasH) {
        this.numeroManillasH = numeroManillasH;
    }

    public Integer getNumeroManillasM() {
        return numeroManillasM;
    }

    public void setNumeroManillasM(Integer numeroManillasM) {
        this.numeroManillasM = numeroManillasM;
    }

   

    
    public Factura getFactura() {
        return factura;
    }

    public void setFactura(Factura factura) {
        this.factura = factura;
    }

    public Cliente getCedula() {
        return cedula;
    }

    public void setCedula(Cliente cedula) {
        this.cedula = cedula;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idingreso != null ? idingreso.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Ingreso)) {
            return false;
        }
        Ingreso other = (Ingreso) object;
        if ((this.idingreso == null && other.idingreso != null) || (this.idingreso != null && !this.idingreso.equals(other.idingreso))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jjsoft.disco.gco.mdl.Ingreso[ idingreso=" + idingreso + " ]";
    }
    
}
